<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        
        .one {
            width: 200px;
            height: 100px;
            margin: 0 auto;
            background-color: gray;
            color: white;
            font-size: 30px;
            line-height: 100px;
            text-align: center;
            border-radius: 10px;
        }

        .two {
            width: 50px;
            height: 50px;
            margin:10px auto;
            display: block;
            font-size: 30px;
            line-height: 50px;
        }
    </style>

</head>
<body>
        <div class="one">0</div>
        <button class ="two">+</button>

    <script>
        
        let screen = document.querySelector('.one');
        let add = document.querySelector('.two');

        add.onclick = function() {
            let num = screen.innerHTML;
            num = parseInt(num);
            num += 1;
            screen.innerHTML = num;
        }


    </script>


    <!-- <div>这是一个div</div>

     <h1 class="abc">这是一个标题</h1>
    <h1>这也是一个标题</h1> -->

    <!-- <script>
       let elem =  document.querySelector('div');
       elem.onclick = function() {
        console.log(elem.innerHTML);
        elem.innerHTML += '这是追加的内容';
       }
    </script> -->
</body>
</html>